package com.project_test.kun.travelling_1st.GoodsDetailActivities.CarDetail;

import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by asus on 2016/10/17 09 49.
 * 邮箱:763433963@qq.com
 */
public class CarDetailBean {
    private String id;
    private String city_id;
    private String city_name;
    private String uid;
    private String uname;
    private String vehicle_type;
    private String vehicle_brands;
    private String vehicle_model;
    private String vehicle_no;
    private String driven_distance;
    private String vehicle_years;
    private String driven_years;
    private String driver_intro;
    private String title;
    private String price;
    private String invoice;
    private String long_service;
    private String service_mileage;
    private String exceed_intro;
    private String price_involve;
    private String price_noinvolve;
    private String people_num;
    private String baggage_num;
    private String service_guide;
    private String service_translate;
    private String child_seats;
    private String service_other;
    private String status;
    private String city;
    private String picList;
    private String[] piclists;
//                "picList": [
//        "http://img2.handybest.com/Uploads/Car/920/16/06/5760b9d98e7c5.jpg!phone",
//                "http://img3.handybest.com/Uploads/Car/920/16/06/5760b9f0593b7.jpg!phone",
//                "http://img2.handybest.com/Uploads/Car/920/16/06/576219638e6b9.jpg!phone",
//                "http://img1.handybest.com/Uploads/Car/920/16/06/576219638f2b9.jpg!phone",
//                "http://img2.handybest.com/Uploads/Car/920/16/06/57621963902db.jpg!phone",
//                "http://img1.handybest.com/Uploads/Car/920/16/06/57621963915d2.jpg!phone"
//        ],
    private String vehicle_type_name;
    private Refund refund;

        public void parseJson(JSONObject json) throws JSONException {

            if (json != null) {
                id = json.optString("id");
                city_id = json.optString("city_id");
                city_name = json.optString("city_name");
                uid = json.optString("uid");
                uname = json.optString("uname");
                vehicle_type = json.optString("vehicle_type");
                vehicle_brands= json.optString("vehicle_brands");
                vehicle_model = json.optString("vehicle_model");
                vehicle_no = json.optString("vehicle_no");
                driven_distance= json.optString("driven_distance");
                vehicle_years = json.optString("vehicle_years");
                driven_years = json.optString("driven_years");
                driver_intro = json.optString("driver_intro");
                title = json.optString("title");
                price = json.optString("price");
                invoice= json.optString("invoice");
                long_service= json.optString("long_service");
                exceed_intro= json.optString("exceed_intro");
                price_involve = json.optString("price_involve");
                price_noinvolve = json.optString("price_noinvolve");
                people_num= json.optString("people_num");
                baggage_num= json.optString("baggage_num");
                service_guide = json.optString("service_guide");
                service_translate = json.optString("service_translate");
                child_seats = json.optString("child_seats");
                service_other = json.optString("service_other");
                status = json.optString("status");
                city= json.optString("city");
                service_mileage=json.optString("service_mileage");
                vehicle_type_name=json.optString("vehicle_type_name");
                picList=json.optString("picList");
                piclists = picList.split(",");
                for (int i = 0; i < piclists.length; i++) {
                    Log.e("parseJson: ",piclists[i]+"\n" );
                }
                refund=new Refund();
                JSONObject json1=json.getJSONObject("refund");
                refund.parseJson(json1);
            }

         }

    private class Refund {
        private String title;
        private String description;

        public void parseJson(JSONObject json) throws JSONException {
            if (json != null) {
                title = json.optString("title");
                description = json.optString("description");
            }
        }

        public String getTitle() {
            return title;
        }

        public String getDescription() {
            return description;
        }
    }

    public String getId() {
        return id;
    }

    public String getCity_id() {
        return city_id;
    }

    public String getCity_name() {
        return city_name;
    }

    public String getUid() {
        return uid;
    }

    public String getUname() {
        return uname;
    }

    public String getVehicle_type() {
        return vehicle_type;
    }

    public String getVehicle_brands() {
        return vehicle_brands;
    }

    public String getVehicle_model() {
        return vehicle_model;
    }

    public String getVehicle_no() {
        return vehicle_no;
    }

    public String getDriven_distance() {
        return driven_distance;
    }

    public String getVehicle_years() {
        return vehicle_years;
    }

    public String getDriven_years() {
        return driven_years;
    }

    public String getDriver_intro() {
        return driver_intro;
    }

    public String getTitle() {
        return title;
    }

    public String getPrice() {
        return price;
    }

    public String getInvoice() {
        return invoice;
    }

    public String getLong_service() {
        return long_service;
    }

    public String getService_mileage() {
        return service_mileage;
    }

    public String getExceed_intro() {
        return exceed_intro;
    }

    public String getPrice_involve() {
        return price_involve;
    }

    public String getPrice_noinvolve() {
        return price_noinvolve;
    }

    public String getPeople_num() {
        return people_num;
    }

    public String getBaggage_num() {
        return baggage_num;
    }

    public String getService_guide() {
        return service_guide;
    }

    public String getService_translate() {
        return service_translate;
    }

    public String getChild_seats() {
        return child_seats;
    }

    public String getService_other() {
        return service_other;
    }

    public String getStatus() {
        return status;
    }

    public String getCity() {
        return city;
    }

    public String getPicList() {
        return picList;
    }

    public String getVehicle_type_name() {
        return vehicle_type_name;
    }

    public Refund getRefund() {
        return refund;
    }

    public String[] getPiclists() {
        return piclists;
    }
}
